import moment from 'moment';
import React from 'react';
import { Table, Descriptions, Card } from 'antd';

class ViewPage extends React.Component<any, any> {
    render() {
        const { data, configData } = this.props
        const node = data.data;
        const details = data.details;
        const columns = [
            {
                title: '序号',
                dataIndex: 'packLine',
            },
            {
                title: '物料编码',
                dataIndex: 'partNum',
            },
            {
                title: '描述',
                dataIndex: 'partDescription',
            },
            {
                title: '收货数量',
                dataIndex: 'ourQty',
            },
            {
                title: '单位',
                dataIndex: 'ium',
            },
        ];
        return (

            <Card bordered={false} key="C1">
                <Descriptions title={<h2 style={{ textAlign: 'center' }}>收货入库单</h2>} bordered={false}>
                    <Descriptions.Item label="收货单号">{node?.packSlip}</Descriptions.Item>
                    <Descriptions.Item label="公司名称"><strong>{configData.companyName}</strong></Descriptions.Item>
                    <Descriptions.Item label="收货人">{node?.receivePerson}</Descriptions.Item>
                    <Descriptions.Item label="收货日期">{moment(node?.receiptDate).format('YYYY-MM-DD')}</Descriptions.Item>
                </Descriptions>
                <Table
                    columns={columns}
                    dataSource={details}
                    pagination={false}
                    bordered
                />
                <br />
                <Descriptions bordered={false}>
                    <Descriptions.Item label="仓管签字">__________</Descriptions.Item>
                    <Descriptions.Item label="收货人签字">__________</Descriptions.Item>
                </Descriptions>

            </Card>
        )
    }
}

export default ViewPage